/*
 * main.cpp
 *
 *  Created on: 30/05/2011
 *      Author: dela
 */

#include <iostream>
#include "common/Course.h"

using namespace std;

/**
 *
 */
int main(int argc, char *argv[]) {

	/**
	 * Test de paso de un Class a buffer y vuelta a Class.
	 */

	Class c;
	c.setId(8);
	c.setName("Mi Nombre");
	c.setDescription("Una descripcion");
	c.setHasPassword(true);
	c.setPassword("La password");
	c.setStartDate("30/6/2011");
	c.setDuration("2h");
	c.setAvailableOffline(false);

	int size;
	char *buff = c.toBuffer( &size );

	Class c2 = Class(buff);
	cout << c2.getId() << endl;
	cout << c2.getName() << endl;
	cout << c2.getDescription() << endl;
	cout << c2.getHasPassword() << endl;
	cout << c2.getPassword() << endl;
	cout << c2.getStartDate() << endl;
	cout << c2.getDuration() << endl;
	cout << c2.getAvailableOffline() << endl;

	delete[] buff;
}
